<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
        "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">

<hibernate-mapping package="org.springside.modules.security.domain">
    <class name="Resource" table="system_rescs" dynamic-insert="true" dynamic-update="true">
        <id name="id" type="integer">
            <column name="id" />
            <generator class="native" />
        </id>
        <property name="name" type="string">
            <column name="name" length="50" not-null="true" />
        </property>
        <property name="resType" type="string">
            <column name="res_type" length="25" not-null="true" />
        </property>
        <property name="resString" type="string">
            <column name="res_string" not-null="true" />
        </property>
        <property name="descn" type="string">
            <column name="descn" />
        </property>
        <set name="permissions" table="system_perm_resc" lazy="true" inverse="true" cascade="save-update" batch-size="5">
            <key>
                <column name="resc_id" not-null="true"/>
            </key>
            <many-to-many class="Permission" column="perm_id" outer-join="auto"/>
        </set>
    </class>
</hibernate-mapping>
